package com.cg.asm.example.controller;

import com.alibaba.fastjson.JSONObject;
import com.cg.asm.client.AsmSession;
import com.cg.asm.client.CommonUtil;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;


@Controller
@RequestMapping("/test")
public class Test {

    /**
     * 测试输出
     * @return
     */
    @GetMapping("/out")
    @ResponseBody
    public JSONObject testOut(HttpServletRequest request) {
        System.out.println("into test out method");
        return CommonUtil.successJson(AsmSession.getSessionUserInfo(request));
    }

}
